home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / novell / btrieve / stat30.txt next >
Text File  |  1996-07-10  |  2KB  |  48 lines

  1.                     Btrieve Status 30 & File Recovery
  2.  
  3.  
  4.   The first and most preferred option is to use a back-up copy of the
  5.   damaged file.  If you choose to attempt to rebuild the File Control
  6.   Record of the Btrieve file, some data may still be lost.  You should
  7.   attempt to do a BUTIL -RECOVER <Btrieve file name> <output file name>.
  8.   Then, after creating a new Btrieve file with the same structure as the
  9.   one you are recovering, you can do a BUTIL -LOAD <input file name>
  10.   <new Btrieve file name>, where the Input file name is the same as the
  11.   output file name from the Recover command.
  12.  
  13.   If this does not work, you will need to do the following:
  14.  
  15.   a. Find out how many pages are in your data file.  To do this, just
  16.      take the byte size of the file and divide by the page size.
  17.   b. Create a new Btrieve file with the same characteristics as the file
  18.      you want to recover.
  19.   c. Replace the first page of the damaged file with the first page from
  20.      the new file you just created.  Remember, a page is however many
  21.      bytes you specified when you created the file - some multiple of
  22.      512 bytes.
  23.   d. Replace bytes 26 - 29 of this first page (in the damaged file) with
  24.      the hex value representing the number of pages in your damaged file
  25.      that you calculated in step a.
  26.        example: say your file contains 600,000 pages.  The hex value for
  27.                 this number is 927C0.  When entering these values, keep
  28.                 in mind that high and low order bytes as well as high
  29.                 and low order words get swapped before being stored, so
  30.                 you must store your hex values swapped appropriately.
  31.  
  32.                                          26     27     28     29
  33.                                         ----   ----   ----   ----
  34.                    Hex bytes 26 - 29:   |  |   |  |   |  |   |  |
  35.  
  36.          Decimal 600,000 = Hex 927C0:   |00|   |09|   |27|   |C0|
  37.  
  38.     First, flip byte 26 with byte 27:   |09|   |00|
  39.  
  40.      Then, flip byte 28 with byte 29:                 |C0|   |27|
  41.  
  42.              The results are:    |09|   |00|   |C0|   |27|
  43.  
  44.      So, 09 00 C0 27 would be the four hex values you would load into
  45.      bytes 26 - 29 to represent 600,000 pages.
  46.  
  47.   e. Now you should attempt the Butil Recover and Load process again.
  48.